Skip to main content

WhatsApp Scope

AutomatR.WhatsApp.Activities.WhatsAppScope

The "WhatsApp Scope" activity in AutomatR provides a scoped environment for executing activities related to the WhatsApp service. It is designed to encapsulate a series of WhatsApp-related activities within a defined scope, facilitating better organization and management of WhatsApp interactions.

Properties

NameDescription
Input
Access TokenAllows you to enter the access token used for authentication and authorization with WhatsApp services. Required argument.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "WhatsApp Scope" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.

How to use:

  1. Drag and drop the "WhatsApp Scope" activity onto the workflow.
  2. Configure the properties by specifying the access token required for WhatsApp authentication.
  3. Optionally, configure the delay.
  4. Place other WhatsApp-related activities within the scope of the "WhatsApp Scope" activity.
  5. Execute the workflow to perform WhatsApp activities within the defined scope.

Example: Consider an example where the "WhatsApp Scope" activity is used to send template messages:

WhatsApp Scope:
Display Name: "WhatsApp Interaction"
Access Token: "your_whatsapp_access_token"
Delay: 2
Send Template Messages:
Delay: 1
Template Name: "WelcomeTemplate"
Broadcast Name: "GeneralBroadcast"
Receivers: [{"WhatsAppNumber": "85264318721", "Parameters": {"Name": "John", "Product": "AutomatR"}},
{"WhatsAppNumber": "919876543210", "Parameters": {"Name": "Alice", "Product": "Automation"}}]
Response: templateMessagesResponse

In this example, the "WhatsApp Scope" activity is used to encapsulate the interactions with the WhatsApp service. It ensures that the access token is valid and sets up the necessary HTTP headers. The delay is configured for synchronization, and within the scope, a "Send Template Messages" activity is performed. The response is stored in the templateMessagesResponse variable for further handling in the workflow.